<template>
  <el-dialog
    :destroy-on-close="false"
    :show-close="false"
    v-model="dialogVisible"
    :close-on-click-modal="false"
    :close-on-press-escape="false"
    align-center
    width="454"
  >
    <div class="improve-information">
      <img class="close" @click="close" src="~/assets/img/close.png" alt="" />
      <div class="header">账号信息</div>
      <div class="over">
        <div class="touxiang">
          <span class="name">头像</span>
          <div class="logo">
            <img src="~/assets/img/bbx.png" alt="" />
          </div>
          <span class="r-text">更换头像</span>
        </div>

        <div class="input-box">
          <div class="label">账号ID</div>
          <div class="value">xn5681231</div>
        </div>

        <div class="input-box">
          <div class="label">昵称</div>
          <div class="value">
            <el-input v-model="nickName" placeholder="请输入昵称"></el-input>
          </div>
        </div>

        <div class="input-box">
          <div class="label">绑定手机号</div>
          <div class="value">
            <el-input
              v-model="phone"
              placeholder="未绑定手机号，填写手机号进行绑定"
            ></el-input>
          </div>
          <div class="value">
            <el-input v-model="yzm" placeholder="输入验证码"></el-input>
            <el-button type="primary">发送验证码</el-button>
          </div>
        </div>
        <div class="input-box">
          <div class="label">账号绑定</div>
          <div class="value"></div>
        </div>
        <div class="input-box">
          <div class="label">其他信息</div>
          <div class="value" @click="IIOverClick">
            完善信息
          </div>
        </div>

        <div class="footer">
          <el-button class="cancel" @click="close">取消</el-button>
          <el-button class="confirm" @click="close">保存</el-button>
        </div>
      </div>
    </div>
  </el-dialog>
  <IIOver ref="IIOverRef" />
</template>

<script setup>
const nickName = ref("");
const phone = ref("");
const yzm = ref("");
const IIOverRef = ref()
const dialogVisible = ref(false);
const close = () => {
  dialogVisible.value = false;
};
const show = () => {
  dialogVisible.value = true;
};
const IIOverClick = ()=>{
  IIOverRef.value?.show()
}
defineExpose({
  close,
  show,
});
</script>

<style lang="scss" scoped>
.improve-information {
  background: #ffffff;
  border-radius: 10px;
  position: relative;
  .close {
    position: absolute;
    width: 20px;
    height: 20px;
    top: 20px;
    right: 20px;
    cursor: pointer;
  }
  .header {
    height: 69px;
    background: #f0fbf9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border-radius: 10px 10px 0 0;
  }
  .over {
    display: flex;
    flex-direction: column;
    .footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 20px;
      padding: 0 36px 36px;
      ::v-deep .el-button.cancel {
        width: 277px;
        height: 52px;
        background: #d8e7e4;
        border-radius: 5px;
        font-size: 16px;
        font-weight: 400;
        text-align: center;
        color: #32c7aa;
      }
      ::v-deep .el-button.confirm {
        width: 277px;
        height: 52px;
        background: #32c7aa;
        border-radius: 5px;
        font-size: 16px;
        font-weight: 400;
        text-align: center;
        color: #fff;
      }
    }
    .touxiang {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 36px;
      .name {
        font-size: 16px;
        font-weight: 500;
        color: #666666;
        margin-right: 20px;
      }
      .logo {
        flex: 1;
        flex-shrink: 0;
        > img {
          width: 66px;
          height: 66px;
        }
      }
      .r-text {
        color: #32c7aa;
        font-size: 16px;
        font-weight: 500;
      }
    }
    .input-box {
      margin: 10px auto;
      .label {
        font-size: 16px;
        font-weight: 500;
        text-align: LEFT;
        color: #666666;
      }
      .value {
        width: 334px;
        height: 44px;
        line-height: 44px;
        background: #f2f2f2;
        border-radius: 5px;
        padding: 10px;
        margin-top: 10px;
      }
    }

    .edit {
      border-top: 1px solid #f4f4f4;
      height: 22px;
      font-size: 16px;
      font-weight: 500;
      text-align: center;
      color: #ff5500;
      line-height: 19px;
      padding-top: 20px;
      margin-top: 10px;
    }
  }
}
</style>
